<!--  -->
<template>
  <div>
    <h1>个人中心</h1>
    <van-button type="primary" size="large">btn</van-button>
    <van-button type="info" size="small">btn</van-button>
    <van-button type="danger" size="mini">btn</van-button>
    <van-button type="warning">btn</van-button>
    <van-button type="default" color="orange">btn</van-button>
    <van-button type="default" color="orange" icon="like-o">btn</van-button>
    <!-- 图标组件 -->
    <van-icon name="like-o" color="red" badge="9"></van-icon>
    <van-icon name="like" color="red" size="40px" dot></van-icon>
    <!-- 表单 -->
    <van-form @submit="onSubmit">
      <van-field
        v-model="username"
        name="用户名"
        label="用户名"
        placeholder="用户名"
        :rules="[{ required: true, message: '请填写用户名' }]"
      />
      <van-field
        v-model="password"
        type="password"
        name="密码"
        label="密码"
        placeholder="密码"
        :rules="[{ required: true, message: '请填写密码' }]"
      />
      <div style="margin: 16px">
        <van-button round block type="info" native-type="submit">
          提交
        </van-button>
      </div>
    </van-form>
    <!-- 导航 -->
    <van-nav-bar
      title="home页面"
      left-text="back"
      right-text="三"
      left-arrow
      @click-left="onClickLeft"
      @click-right="onClickRight"
    />

    <van-nav-bar title="标题" left-text="返回" left-arrow>
      <template #right>
        <van-icon name="search" size="18" />
      </template>
    </van-nav-bar>
  </div>
</template>

<script>
export default {
  data() {
    return {
      username: "",
      password: "",
    };
  },
  methods: {
    onSubmit(values) {
      console.log("submit", values);
    },
    onClickLeft() {
      // 吐丝
      // Toast("back")
      this.$toast({
        message: "back",
        position: "bottom",
      });
    },
    onClickRight() {
      this.$toast("more");
    },
  },
};
</script>
<style lang='scss' scoped>
h1 {
  text-align: center;
}
</style>